package com.huike.service.contract.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.huike.dto.ContractDTO;
import com.huike.mapper.contract.ContractMapper;
import com.huike.result.PageResult;
import com.huike.service.contract.ContractService;
import com.huike.vo.ContractVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ContractServiceImpl implements ContractService {

    @Autowired
    private ContractMapper contractMapper;

    @Override
    public PageResult page(ContractDTO dto) {
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());

        Page<ContractVO> vo=contractMapper.page(dto);

        return new PageResult(vo.getTotal(),vo.getResult(),200,"查询成功",null);
    }
}
